/**
 * Created by 李伟伟 on 2019/10/6.
 */
import req from './index';

const BASE_URL = '/api';

//用户登录后获取可操作的权限
export const getPermission = (param)=>{return req(param,`${BASE_URL}/actionController/getPermission`,"post")};

//获取所有权限信息
export const getAllAction = (param)=>{return req(param,`${BASE_URL}/actionController/getAllAction`,"post")};

//修改指定的权限
export const updateAction = (param)=>{return req(param,`${BASE_URL}/actionController/updateAction`,"post")};

//根据id查询对应的权限
export const getActionByActionId = (param)=>{return req(param,`${BASE_URL}/actionController/getActionByActionId`,"post")};

//根据id删除对应的权限信息
export const deleteActionById = (param)=>{return req(param,`${BASE_URL}//actionController/deleteActionById`,"post")};

//为角色添加权限
export const addGroupAction = (param)=>{return req(param,`${BASE_URL}/groupActionController/addGroupAction`,"post")};

//为指定角色删除权限
export const deleteGroupAction = (param)=>{return req(param,`${BASE_URL}/groupActionController/deleteGroupAction`,"post")};

//获取所有角色信息
export const getAllGroup = (param)=>{return req(param,`${BASE_URL}/groupController/getAllGroup`,"post")};

//添加角色
export const addGroup = (param)=>{return req(param,`${BASE_URL}/groupController/addGroup`,"post")};

//修改角色
export const updateGroup = (param)=>{return req(param,`${BASE_URL}/groupController/updateGroup`,"post")};

//删除角色
export const deleteGroup = (param)=>{return req(param,`${BASE_URL}/groupController/deleteGroup`,"post")};

//获取指定角色的权限树
export const findActionTreeByGrId = (param)=>{return req(param,`${BASE_URL}/groupController/findActionTreeByGrId`,"post")};

//为指定的用户添加角色
export const addUserGroup = (param)=>{return req(param,`${BASE_URL}/userGroupController/addUserGroup`,"post")};

//为指定的用户删除其对应的角色
export const deleteUserGroup = (param)=>{return req(param,`${BASE_URL}/userGroupController/deleteUserGroup`,"post")};


